class OJLD :
	def __init__(self,num1,num2):
		self.imax = 0
		self.imin = 0
		if num1 >= num2:
			self.imax = num1
			self.imin = num2
		else :
			self.imax = num2
			self.imin = num1
	def cal(self):
		temp = 0
		while (self.imin != 1 or self.imin != 0):
			self.imin = self.imax % self.imin
			print "No.%d : %d" %(temp , self.imin)
			temp += 1 

if __name__ == "__main__":
	num1 = raw_input ("num1> ")
	num1 = int (num1)
	num2 = raw_input ("num2> ")
	num2 = int (num2)

	number = OJLD(num1,num2)
	number.cal()
